{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "responsible-general",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/search-in-a-binary-search-tree\n",
    "\n",
    "\n",
    "Runtime: 80 ms, faster than 27.98% of Python3 online submissions for Search in a Binary Search Tree.\n",
    "Memory Usage: 16.1 MB, less than 60.93% of Python3 online submissions for Search in a Binary Search Tree.\n",
    "\n",
    "\n",
    "```python\n",
    "class Solution:\n",
    "    def searchBST(self, root: TreeNode, val: int) -> TreeNode:\n",
    "        #7:00\n",
    "        node = root\n",
    "        while node != None:\n",
    "            if node.val == val:\n",
    "                return node\n",
    "            elif val < node.val:\n",
    "                node = node.left\n",
    "            elif val > node.val:\n",
    "                node = node.right\n",
    "        return None\n",
    "        #7:05\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "logical-alert",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
